package com.gargi.crimpatrol.utils;

import java.io.IOException;

import com.sun.lwuit.Font;
import com.sun.lwuit.Image;

public class Constant {
	
	//default url
	public final static String BASE_URL = "https://gdata.youtube.com/feeds/api/playlists/";
	public final static String CRIME_PATROL_PLAYLIST_ID = "PLzufeTFnhupza0aEZ_FKj0mBguCdtwU_c";
	public final static String YOUTUBE_API_VERSION = "?v=2";
	
	//default image
	public final static Image DEFAULT_IMAGE = loadImage("thumbnail.png");
	
	// xml tags
	public final static String FEED_TAG = "feed";
	public final static String ENTRY_TAG = "entry";
	public final static String TITLE_TAG = "title";
	public final static String DES_TAG = "media:description";
	public final static String APP_DRAFT_TAG = "app:draft";
	public final static String THUMBNAIL_TAG = "media:thumbnail";
	public final static String URL_TAG = "url";
	public final static String RSTP_TAG = "media:content";
	
	//midlet keys
	public final static String MIDLET_VERSION = "Midlet-Version";
	public final static String MIDLET_NAME = "Midlet-Name";
	public final static String MIDLET_VENDOR = "Midlet-Vendor";
	
	//fonts
    public static final Font SMALL_BOLD_FONT = Font.createSystemFont(
            Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_SMALL);
	
	// logger method
	public static void log(String msg) {
		System.out.println(msg);
	}
	
	//load image
    public static Image loadImage(String filename) {
        String path = "/";

        try {
            // Load image
            return Image.createImage(path + filename);
        }
        catch (IOException ioe) {
        }
        return null;
    }
    
    //resize image
    public static Image getImageResize(Image mg,int hight, int width)
    {
        try {
            Image img = mg;
            img = img.scaled(width, hight);
            return img;
        } catch (Exception e) {
            return null;
        }
    }
	
}
